﻿using Opc.Ua;
using System.Collections.Generic;

namespace SD.OpcProxy.OpcService.Proxy
{
    /// <summary>
    /// 代理变量组
    /// </summary>
    public class ProxyVariableGroup : FolderState
    {
        /// <summary>
        /// 创建代理变量组构造器
        /// </summary>
        /// <param name="groupName">组名称</param>
        /// <param name="description">描述</param>
        public ProxyVariableGroup(string groupName, string description)
            : base(null)
        {
            base.SymbolicName = groupName;
            base.ReferenceTypeId = ReferenceTypes.Organizes;
            base.TypeDefinitionId = ObjectTypeIds.FolderType;
            base.Description = description;
            base.NodeId = new NodeId(groupName);
            base.BrowseName = new QualifiedName(groupName);
            base.DisplayName = new LocalizedText(groupName);
            base.WriteMask = AttributeWriteMask.None;
            base.UserWriteMask = AttributeWriteMask.None;
            base.EventNotifier = EventNotifiers.None;
        }

        /// <summary>
        /// 代理变量列表
        /// </summary>
        public IEnumerable<ProxyVariable> ProxyVariables { get; set; }
    }
}